cmake_minimum_required(VERSION 2.8)

option(RELEASE "on for release" off)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

if(${RELEASE})
        set(CMAKE_C_FLAGS "-std=c99 -Wall -g -O0 -D_GNU_SOURCE -DDBUG")
else()
        set(CMAKE_C_FLAGS "-std=c99 -Wall -O2 -D_GNU_SOURCE")
endif()

add_executable(worker worker.c lock.c main.c sock.c cfg.c
        control.c daemon.c event.c signals.c)

target_link_libraries(worker pthread)

add_executable(client client.c sock.c)
